/* 歌单api */
import request from "@/utils/request"
import store from "@/store"
let cookie = store.state.usercookie
// console.log(cookie);
/* 
收藏喜欢音乐
 */
export const likemusicAPI = (id,like) => {
    return request({
      method: "GET",
      url: "/like",
      params: {
        id,
        like,
        cookie
      },
    })
  }
  /* 
获取歌曲歌词
 */
export const getmusiclyricAPI = (id) => {
  return request({
    method: "GET",
    url: "/lyric",
    params: {
      id,
      cookie
    },
  })
}

/* 
获取音乐数据
 */
export const getmusicdetailAPI = (ids) => {
  return request({
    method: "GET",
    url: "/song/detail",
    params: {
      ids,
      cookie
    },
  })
}
/* 
获取音乐url
 */
export const getmusicurlAPI = (ids) => {
  return request({
    method: "GET",
    url: "/song/url",
    params: {
      ids,
      cookie
    },
  })
}

/* 
获取音乐url
 */
export const getdownloadmusicurlAPI = (id) => {
  return request({
    method: "GET",
    url: "/song/download/url",
    params: {
      id,
      cookie
    },
  })
}
/* 
获取音乐评论
 */
export const getmusiccommentAPI = ( id,limit,offset,before) => {
  return request({
    method: "GET",
    url: "/comment/music",
    params: {
      id,
      limit,
      offset,
      before,
      cookie,
    },
  })
}

